package com.huang.auth.converter;

import com.huang.auth.constants.AuthConstants;
import com.huang.auth.entity.po.AuthResourcePO;
import com.huang.auth.entity.vo.AuthMenuSimpleVO;
import com.huang.base.core.BaseConvertor;
import org.springframework.stereotype.Component;

@Component
public class AuthResourcePOTOMenuSimpleVO extends BaseConvertor<AuthResourcePO, AuthMenuSimpleVO> {
    @Override
    public AuthMenuSimpleVO doConvert(AuthResourcePO m) {
        AuthMenuSimpleVO authMenuSimpleVO = new AuthMenuSimpleVO();
        // 操作点类型
        authMenuSimpleVO.setType(AuthConstants.SIMPLE_TYPE_RESOURCE);
        authMenuSimpleVO.setTitle(m.getDescribe());
        authMenuSimpleVO.setDisabled(m.getType());
        authMenuSimpleVO.setId("R"+m.getId().toString());
        return authMenuSimpleVO;
    }
}
